<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>
<html>
<body class="easyui-layout list_body">
	<form id="menuForm" name="menuForm">
		<div class="list_body_north" data-options="region:'north'" border="false">
			<!-- 查询表单 -->
			<div style="padding: 3px" class="easyui-panel datagrid-toolbar">
				<div>
					<span>开始日期:</span>
					<input type="text" id="start_date" name="start_date" class="easyui-datebox" data-options="editable:false" value="${currentDate}"/> 
					<span>结束日期:</span>
					<input type="text" id="end_date" name="end_date" class="easyui-datebox" data-options="editable:false" value="${currentDate}"/> 
					<a href="#" class="easyui-linkbutton btn" iconCls="icon-search" onclick="doSearch()">查询</a>
					<a href="#" class="easyui-linkbutton btn" iconCls="icon-reload" onclick="resetForm()">重置</a>
				</div>
			</div>
			<!-- 自定义标签工具栏 -->
			<jiepos:buttonOperateTag menuCode="${menuCode }"></jiepos:buttonOperateTag>
		</div>
		<div data-options="region:'center'" border="false" class="list_body_center">
			<!-- 表格 -->
			<table id="menuTableId" fit="true"></table>
		</div>
	</form>
</body>
<script type="text/javascript">
	var grid;
	$(function() {
		/*加载表格数据*/
		grid = $("#menuTableId").jpgrid({
			url : "getInsAccountStatementListJson.do",
			baseColumns: false,
			columns : [{
				title : "文件",
				field : "NAME",
				align : 'center'
			},{
				title : "日期",
				field : "DATE",
				align : 'center'
			},{
				title : "机构号",
				field : "INS_CD",
				align : 'center'
			},{
				title : "机构名称",
				field : "INS_NM",
				align : 'center'
			}]
		});
	});

	function doSearch() {
		grid.load({
			start_date : $('#start_date').val(),
			end_date : $('#end_date').val()
		});
	}

	//启用会员账户操作
	function downFile(url) {
		var checkedItems = $('#menuTableId').datagrid('getChecked');
		if (checkedItems.length == 0) {
			$.jpmessage.warning("请选择一条记录！");
			return false;
		}else if(checkedItems.length > 1){
			$.jpmessage.warning("只能选择一条记录！");
			return false;
		}
		var path = checkedItems[0].PATH;
		commonFileDownload(url + encodeURI(path), "menuForm");
	}
</script>
</html>
